﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Info;

namespace YiDingCanWp7
{
    public class PhoneUtils
    {
        public static string GetDeviceUniqueId()
        {
            byte[] result = null;
            object uniqueId;
            if (DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out uniqueId))
            {
                result = (byte[])uniqueId;
            }
            //转换设备ID为字符串
            string DeviceUniqueId = Convert.ToBase64String(result);
            return DeviceUniqueId;
        }
    }
}
